home *** CD-ROM | disk | FTP | other *** search
Wrap
global gMyMessage, gMessageLength, gIterCount, gCharToNumList, gCastNumList, gStopPoint, gStopFlag, gHowLongHold, gBlinkFlag, gBlinkOffset, gNumCharsToBlink, gStopOffset, gWindowName, gMyWindow, gCharColorList, gURLName on startMovie puppetTempo(10) set gWindowName to "LEDMIAW.DIR" set gStopFlag to 0 set gStopPoint to 36 set gHowLongHold to 5 set gURLName to " " beginMyMovie() end on stopMovie finishMovie() end on beginMyMovie if objectp(gMyWindow) then forget(gMyWindow) end if set horzorigin to the stageLeft + ((the stageRight - 400) / 2) set vertorigin to the stageTop + 62 set gMyWindowRect to rect(horzorigin, vertorigin, horzorigin + 400, vertorigin + 14) set gMyWindow to window gWindowName set the rect of gMyWindow to gMyWindowRect set the fileName of gMyWindow to gWindowName set the titleVisible of gMyWindow to 0 set the windowType of gMyWindow to 2 open(gMyWindow) end on finishMovie if objectp(gMyWindow) then forget(gMyWindow) end if end on writeMessage if gIterCount >= (count(gCharToNumList) - 35) then set gIterCount to 0 else repeat with x = 47 down to 12 set myNum to getAt(gCharToNumList, x - 11 + gIterCount) set the foreColor of sprite x to 225 set the castNum of sprite x to myNum end repeat updateStage() set gIterCount to gIterCount + 1 end if end on writeNStop if gIterCount >= (count(gCharToNumList) - 35) then set gIterCount to 0 else if gIterCount = gStopPoint then if gBlinkFlag then go("HoldNBlink") else go("Hold") end if else repeat with x = 47 down to 12 set myNum to getAt(gCharToNumList, x - 11 + gIterCount) set the foreColor of sprite x to 225 set the castNum of sprite x to myNum end repeat updateStage() set gIterCount to gIterCount + 1 end if end if end on saveText set gMyMessage to the text of field "Message" set gCharColorList to [225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225] repeat with i = 1 to the number of chars in gMyMessage set theColor to the foreColor of char i of field "Message" if theColor = 255 then set theColor to 225 end if append(gCharColorList, theColor) end repeat repeat with i = 1 to 35 append(gCharColorList, 255) end repeat set gMyMessage to " " & gMyMessage & " " set gCharToNumList to [] cursor(4) repeat with y = 1 to the number of chars in gMyMessage set myCharToNum to the number of member char y of gMyMessage add(gCharToNumList, myCharToNum) end repeat set whatToWrite to string(gStopPoint) & RETURN & string(gHowLongHold) & RETURN & string(gStopFlag) & RETURN & string(gBlinkFlag) & RETURN & string(gBlinkOffset) & RETURN & string(gNumCharsToBlink) & RETURN & string(gStopOffset) & RETURN & string(gCharToNumList) & RETURN & string(gCharColorList) & RETURN & string(gURLName) & RETURN set myTextFile to fileio(mnew, "?write", "LEDText.txt") if not objectp(myTextFile) then set theProblem to string(myTextFile) checkError(theProblem) cursor(-1) exit else myTextFile(mWriteString, whatToWrite) myTextFile(mdispose) cursor(-1) end if end on readLEDText if objectp(myLEDText) then myLEDText(mdispose) end if set myLEDText to fileio(mnew, "?read", "TEXT") if not objectp(myLEDText) then set theProblem to string(myLEDText) checkError(theProblem) exit else set newLEDValues to myLEDText(mReadFile) myLEDText(mdispose) if not listp(value(line 8 of newLEDValues)) then alert("Not a valid LED Player text file!") else set gStopPoint to value(line 1 of newLEDValues) set gHowLongHold to value(line 2 of newLEDValues) set gStopFlag to value(line 3 of newLEDValues) set gBlinkFlag to value(line 4 of newLEDValues) set gBlinkOffset to value(line 5 of newLEDValues) set gNumCharsToBlink to value(line 6 of newLEDValues) set gStopOffset to value(line 7 of newLEDValues) set gCharToNumList to value(line 8 of newLEDValues) end if if objectp(myLEDText) then myLEDText(mdispose) end if end if end on checkError theProblem if theProblem = -33 then alert("File directory full." & RETURN & RETURN & "Error: " & string(theProblem)) exit end if if theProblem = -34 then alert("This disk is completely full! Please delete some files and make some room." & RETURN & RETURN & "Error: " & string(theProblem)) exit end if if theProblem = -35 then alert("Volume not found." & RETURN & RETURN & "Error: " & string(theProblem)) exit end if if theProblem = -36 then alert("Disk error encountered." & RETURN & RETURN & "Error: " & string(theProblem)) exit end if if theProblem = -37 then alert("The file name you've chosen is no good or you've used an invalid character. Please check then save again." & RETURN & RETURN & "Error: " & string(theProblem)) exit end if if theProblem = -38 then alert("File not open." & RETURN & RETURN & "Error: " & string(theProblem)) exit end if if theProblem = -42 then alert("You've got too many files open!." & RETURN & RETURN & "Error: " & string(theProblem)) exit end if if theProblem = -43 then beep() exit end if if theProblem = -56 then alert("No such drive." & RETURN & RETURN & "Error: " & string(theProblem)) exit end if if theProblem = -65 then alert("No disk in drive." & RETURN & RETURN & "Error: " & string(theProblem)) exit end if if theProblem = -120 then alert("Directory not found." & RETURN & RETURN & "Error: " & string(theProblem)) exit end if end on makeList set gCastNumList to [:] repeat with x = 1 to 48 addProp(gCastNumList, the name of cast x, x) end repeat end